#ifndef CARD_H
#define CARD_H

#include <QVector>

class Card
{
public:
    //花色枚举
    enum CardSuit{
        Suit_Begin,
        Diamond,//方块
        Club,//梅花
        Heart,//红桃
        Spade,//黑桃
        Suit_End
    };
    //点数枚举
    enum CardPoint{
        Card_Begin,
        Card_3,
        Card_4,
        Card_5,
        Card_6,
        Card_7,
        Card_8,
        Card_9,
        Card_10,
        Card_J,
        Card_Q,
        Card_K,
        Card_A,
        Card_2,
        Card_SJ,//小王
        Card_BJ,//大王
        Card_End
    };

    Card();
    Card(CardPoint point, CardSuit suit);
    void setPoint(CardPoint point);//设置点数
    void setSuit(CardSuit suit);//设置花色
    CardPoint point() const;//获取点数
    CardSuit suit() const;//获取花色

private:
    CardPoint m_point;//点数私有变量
    CardSuit m_suit;//花色私有变量
};

//对象比较函数
bool lessSort(const Card& c1, const Card& c2);
bool greaterSort(const Card& c1, const Card& c2);
bool operator <(const Card& left, const Card& right);

//操作符==和QHash函数重载（因为QSet不支持直接使用用户定义的类型）
bool operator ==(const Card& left, const Card& right);
uint qHash(const Card& card);

//定义QVector类型的别名
using CardList = QVector<Card>;

#endif // CARD_H
